package fun.formoji;

import cn.pecs.api.note.Note;
import cn.pecs.api.note.NoteServiceGrpc;
import cn.pecs.api.note.Note.NoteResult;
import cn.pecs.api.note.NoteServiceGrpc.NoteServiceBlockingStub;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;

public class Client {
    public static void main(String[] args) {
        ManagedChannel channel = ManagedChannelBuilder.forAddress("localhost", 31198)
            .usePlaintext()
            .build();

            NoteServiceBlockingStub stub = NoteServiceGrpc.newBlockingStub(channel);
            Note.NoteDto note = Note.NoteDto.newBuilder().setId(147191225296072704L).build();
            NoteResult noteResult = stub.getNote(note);
            System.out.println("Start!=====================");

            System.out.println(noteResult);
            System.out.println("Done!=====================");

    }
}